# Maintainer: Evangelos Foutras <evangelos@foutrelis.com>

pkgname=openmp
pkgver=12.0.1
pkgrel=1
pkgdesc="LLVM OpenMP Runtime Library"
arch=('x86_64')
url="https://openmp.llvm.org/"
license=('custom:Apache 2.0 with LLVM Exception')
depends=('glibc' 'libelf' 'libffi')
makedepends=('cmake' 'ninja')
_source_base=https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver
source=($_source_base/$pkgname-$pkgver.src.tar.xz{,.sig})
sha256sums=('60fe79440eaa9ebf583a6ea7f81501310388c02754dbe7dc210776014d06b091'
            'SKIP')
validpgpkeys+=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg <hans@chromium.org>
validpgpkeys+=('474E22316ABF4785A88C6E8EA2C794A986419D8A') # Tom Stellard <tstellar@redhat.com>

prepare() {
	cd "$pkgname-$pkgver.src"
	mkdir build
}

build() {
	cd "$pkgname-$pkgver.src/build"

  cmake .. -G Ninja \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DLIBOMP_INSTALL_ALIASES=OFF
  ninja
}

package() {
  cd "$pkgname-$pkgver.src/build"

  DESTDIR="$pkgdir" ninja install
  install -Dm644 ../LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm "$pkgdir/usr/lib/libarcher_static.a"
}

# vim:set ts=2 sw=2 et:
